#include "string.h"

inline void memcpy(uint8_t *dest, const uint8_t *src, uint32_t len)
{
    for (; len != 0; len--)
    {
        *dest++ = *src++;
    }
}

inline void memset(void *dest, uint8_t val, uint32_t len)
{
    uint8_t *dst = (uint8_t *)dest;

    for (; len != 0; len--)
    {
        *dst++ = val;
    }
}

inline void bzero(void *dest, uint32_t len)
{
    memset(dest, 0, len);
}
int strcmp(const char *str1, const char *str2)
{
    int i;
    for (i = 0; str1[i] == str2[i]; i++)
    {
        if (str2[i] == '\0')
        {
            return 0;
        }
    }
    return str1[i] - str2[i];
}

int strlen(const char *s)
{
    int i = 0;
    while (s[i] != '\0')
    {
        ++i;
    }
    return i;
}